export type SelectColumns = { text: string; value: number | string }[];

export type Props = {
  field?: string;
  label?: string;
  disabled?: boolean;
  required?: boolean;
  placeholder?: string;
  labelWidth?: string | number;
  columns?: SelectColumns;
  readonly?: boolean;
  show: boolean;
  rules?: {
    validator?: () => any;
    message?: string;
    pattern?: RegExp;
    required?: true;
  }[];
  format?: (record: any, schema: ItemSchema) => any;
  change?: (record?: any, formValue?: any, schema?: ItemSchema[]) => void;
  [propName: string]: any;
};

export type ItemSchema = {
  component: any;
  props?: Props;
  dictType?: string;
};

export type ItemColumn = {
  field: string | string[];
  label: string;
  type?: 'attachment';
  props?: {
    namespace?: string;
  };
  component?: any;
  dictType?: string;
  format?: (column: ItemColumn, formValue?: any) => any;
};
